#!/usr/bin/env python3

# -*- coding: utf-8 -*-

# @author: zhangbo

# @time: 2025/3/14 19:50

from utils.read_yaml import Read_yaml


class OverThermalBase:

    def __init__(self, yaml_path):
        self.login_config = Read_yaml(yaml_path).get_config_data("overThermal_config")

    def alarm_center_li(self):
        """
        报警中心
        :return:
        """
        return self.login_config["overThermal_config"]["alarmCenter"]

    def alarm_rules_a(self):
        """
        报警规则
        :return:
        """
        return self.login_config["overThermal_config"]["alarmRules"]

    def over_thermal_rules_li(self):
        """
        超温报警规则
        :return:
        """
        return self.login_config["overThermal_config"]["overThermalRules"]

    def add_over_thermal(self):
        """
        添加超温规则
        :return:
        """
        return self.login_config["overThermal_config"]["addOverThermal"]

    def enable_over_thermal(self):
        """
        启用
        :return:
        """
        return self.login_config["overThermal_config"]["enable"]

    def alarm_name(self):
        """
        报警名称
        :return:
        """
        return self.login_config["overThermal_config"]["alarm_name"]

    def one_temperature_requirements(self):
        """
        一路温度要求
        :return:
        """
        return self.login_config["overThermal_config"]["one_road_tallest_thermal"], \
            self.login_config["overThermal_config"]["one_road_lowest_thermal"], \
            self.login_config["overThermal_config"]["continued_time"]

    def click_save_button(self):
        """
        点击保存按钮
        :return:
        """
        return self.login_config["overThermal_config"]["save_button"]

    def get_simulator_conf_parameters(self):
        """
        获取模拟器 simulator_conf 配置文件参数
        :return:
        """

        # 获取phone
        phone = self.login_config["dev"]["phone"]
        terminalNum = self.login_config["dev"]["terminalNum"]
        serverIP = self.login_config["env"]["serverIP"]
        serverPort = self.login_config["env"]["serverPort"]
        fullGps = self.login_config["env"]["fullGps"]
        conf_path = self.login_config["file_path"]["conf"]
        gps_info = self.login_config["file_path"]["gps_info"]

        return phone, terminalNum, serverIP, serverPort, fullGps, conf_path, gps_info

    def get_exe_path(self):
        """
        获取exe_path 路径地址
        :return:
        """

        return self.login_config["file_path"]["exe_path"]

    def get_alarm_center(self):
        """
        报警台账
        :return:
        """
        return self.login_config["overThermal_config"]["alarmLedger"]

    def get_alarm_ledger_clear_button(self):
        """
        报警条件清除
        :return:
        """
        return self.login_config["overThermal_config"]["alarmLedgerClearButton"]

    def get_alarm_type(self):
        """
        选择报警类型
        :return:
        """
        return self.login_config["overThermal_config"]["alarmType"]

    def get_choose_over_thermal(self):
        """
        选择超温告警
        :return:
        """
        return self.login_config["overThermal_config"]["alarmTypeOverThermal"]

    def get_car_num_input(self):
        """
        点击车牌号控件
        :return:
        """
        return self.login_config["overThermal_config"]["car_num_input"], self.login_config["overThermal_config"][
            "car_num"]

    def car_id(self):
        """
        车牌号
        :return:
        """

        return self.login_config["dev"]["car_id"]

    def get_start_end_time(self):
        """
        报警开始结束时间
        :return:
        """
        return self.login_config["overThermal_config"]["start_input_time"], self.login_config["overThermal_config"][
            "end_input_time"]

    def query_button(self):
        """
        查询按钮
        :return:
        """
        return self.login_config["overThermal_config"]["query_button"]

    def result_element_tr(self):
        """
        报警上报条件
        :return:
        """
        return self.login_config["overThermal_config"]["alarm_result"]

